package com.thinking.in.spring.bean.definition;

import com.sun.media.sound.SoftTuning;
import com.think.in.spring.ioc.overview.domain.User;
import com.thinking.in.spring.bean.factory.UserFactory;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Iterator;
import java.util.ServiceLoader;

/**
 *
 * bean 初始化的方式 ：
 *
 * @author : zjj
 * @date : 2021/12/28 17:09
 */
public class BeanInstantiationDemo {

    public static void main(String[] args) {
        BeanFactory beanFactory = new ClassPathXmlApplicationContext("META-INF/bean-instantiation-context.xml");
        User bean = beanFactory.getBean("user-by-factory-method", User.class);

        System.out.println(bean);

    }

}
